#include <mesh.h>
Inheritance diagram for mudbox::Mesh:
Mudbox models are represented by objects of the class Geometry. Each Geometry object contains a list of Meshes, one for each subdivision level. Each mesh is either entirely triangles, or entirely quads.
Public Member Functions |
|
virtual const mudbox::ClassDesc * | RuntimeClass (void) const |
virtual class Geometry * | Geometry (void) const |
Returns a pointer to the Geometry object that this mesh
belongs to. |
|
virtual class MeshRenderer * | Renderer (float fLODLevel=1.0f) |
Returns a pointer to a MeshRenderer with the
desired level-of-detail (see MeshRenderer for more
information). |
|
virtual void | CopyTo (Mesh *pDestination) const |
Copy the content of this mesh to another
one. |
|
virtual class Material * | Material (void) const |
Returns a pointer to the Material associated with this
mesh. |
|
unsigned int | VertexCount (void) const |
Returns the number of vertices in the mesh.
|
|
void | SetVertexCount (unsigned int iVertexCount) |
Sets the number of vertices in the mesh. Any
existing data (that fits) will be kept. |
|
unsigned int | TCCount (void) const |
Returns the number of texture coordinates in
the mesh. |
|
virtual void | SetTCCount (unsigned int iTCCount) |
Sets the number of texture coordinate
vertices in the mesh. |
|
const Vertex * | VertexArray (void) const |
This method returns a pointer to the actual
array data. |
|
const Vertex & | VertexData (unsigned int iVertexIndex) const |
Returns a vertex. |
|
Vertex & | VertexData (unsigned int iVertexIndex) |
Returns a vertex. |
|
const Vector & | VertexPosition (unsigned int iVertexIndex) const |
Returns the x,y,z position of the vertex
with the given index. |
|
Vector & | VertexPosition (unsigned int iVertexIndex) |
Returns the x,y,z position of the vertex
with the given index. |
|
virtual const Vector & | VertexOriginalPosition (unsigned int iVertexIndex) const |
Returns the position of the vertex before
the current sculpting-brush stroke. |
|
const TC & | VertexTC (unsigned int iVertexTCIndex) const |
Returns the specified texture coordinate.
|
|
Vector | VertexNormal (unsigned int iVertexIndex) const |
Returns the normal of the vertex with the
given index. |
|
unsigned int | VertexStrokeID (unsigned int iVertexIndex) const |
Internal use only. Do not call this method.
|
|
float | VertexMask (unsigned int iVertexIndex) const |
Returns the layer mask of the vertex with
the given index for the current sculpt layer. |
|
float | VertexFreeze (unsigned int iVertexIndex) const |
Returns the freeze value of the vertex with
the given index. (0.0 is not frozen; 1.0 is completely frozen).
|
|
unsigned int | FrozenVertexCount (void) const |
Returns the number of vertices having a
non-zero freeze value. |
|
const tnormal * | VertexNormalArray (unsigned int iVertexIndex) const |
Returns the normal of the vertex with the
given index as an array of 16-bit signed values. |
|
tnormalv | VertexNormalValue (unsigned int iVertexIndex) const |
Returns the normal of the vertex with the
given index as a single 64-bit signed value. |
|
unsigned int | VertexNormalIndex (unsigned int iVertexIndex) const |
virtual AxisAlignedBoundingBox | BoundingBox (void) const |
Returns the bounding box of the mesh in
local space. |
|
void | SetVertexPosition (unsigned int iVertexIndex, const Vector &vPosition) |
Sets the position of the vertex with the
given index. |
|
void | AddVertexPosition (unsigned int iVertexIndex, const Vector &vPosition) |
Adds vPosition to the current position of
the vertex with the given index. |
|
void | SetVertexNormal (unsigned int iVertexIndex, int *pNormal) |
Internal use only. Do not call. |
|
void | SetVertexNormal (unsigned int iVertexIndex, const Vector &vNormal) |
Sets the normal of the vertex with the given
index. |
|
void | SetVertexNormal (unsigned int iVertexIndex, int iNormal) |
Internal use only. Do not call. |
|
void | SetVertexFreeze (unsigned int iVertexIndex, unsigned int iFaceIndex, float fFreeze) |
Sets the freeze value for the vertex with
the given index. |
|
void | SetVertexMask (unsigned int iVertexIndex, float fFMask) |
Internal use only. Do not call. |
|
void | SetVertexStrokeID (unsigned int iVertexIndex, unsigned int iStrokeID) const |
Internal use only. Do not call. |
|
virtual void | MarkVertex (unsigned int iVertexIndex) |
Mark a particular vertex. |
|
virtual bool | IsVertexMarked (unsigned int iVertexIndex) |
Returns true if a particular vertex
is marked. |
|
virtual void | ClearVertexMarks (void) |
Clears all vertex marks. |
|
const Vector & | TriangleVertexPosition (unsigned int iTriangleIndex, unsigned int iCornerIndex) const |
Returns the position of a corner of a mesh
face. |
|
const Vector & | QuadVertexPosition (unsigned int iQuadIndex, unsigned int iCornerIndex) const |
Returns the position of a corner of a mesh
face. Can be used for quadric meshes only. |
|
const TC & | TriangleVertexTC (unsigned int iTriangleIndex, unsigned int iCornerIndex) const |
Returns the texture coordinates of a corner
of a mesh face. |
|
const TC & | QuadVertexTC (unsigned int iQuadIndex, unsigned int iCornerIndex) const |
Returns the texture coordinates of a corner
of a mesh face. Can be used for quadric meshes only. |
|
Vector | TriangleVertexNormal (unsigned int iTriangleIndex, unsigned int iCornerIndex) const |
Returns the normal of a corner of a mesh
face. Can be used for triangular meshes only. |
|
Vector | QuadVertexNormal (unsigned int iQuadIndex, unsigned int iCornerIndex) const |
Returns the normal of a corner of a mesh
face. Can be used for quad meshes only. |
|
float | TriangleVertexFreeze (unsigned int iTriangleIndex, unsigned int iCornerIndex) const |
Returns the freeze value of a corner of a
mesh face. Can be used for triangular meshes only. |
|
float | QuadVertexFreeze (unsigned int iQuadIndex, unsigned int iCornerIndex) const |
Returns the freeze value of a corner of a
mesh face. |
|
const tnormal * | TriangleVertexNormalArray (unsigned int iTriangleIndex, unsigned int iCornerIndex) const |
Returns the normal of a corner of a triangle
mesh face as an array of 16-bit signed values. |
|
const tnormal * | QuadVertexNormalArray (unsigned int iQuadIndex, unsigned int iCornerIndex) const |
Returns the normal of a corner of a quad
mesh face as an array of 16-bit signed values. |
|
tnormalv | TriangleVertexNormalValue (unsigned int iTriangleIndex, unsigned int iCornerIndex) const |
Returns the normal a corner of a triangle
mesh face as a single 64-bit signed value. |
|
tnormalv | QuadVertexNormalValue (unsigned int iQuadIndex, unsigned int iCornerIndex) const |
Returns the normal a corner of a quad mesh
face as a single 64-bit signed value. |
|
virtual void | EnumerateFaces (unsigned int iFaceIndex, FaceEnumerator *pEnumerator, bool bSymmetry=false) |
This method takes an operation that you
define (derived from FaceEnumerator) and
applies it to the specified face, and sequentially to its
neighbors, then the neighbors of those faces, until the mesh has
been covered. |
|
virtual void | EnumerateNearestFaces (unsigned int iFaceIndex, FaceEnumerator *pOperation) |
This method takes an operation that you
define (derived from FaceEnumerator) and
applies it to the specified face, and sequentially to its immediate
neighbours. |
|
virtual void | EnumerateVertices (unsigned int iFaceIndex, VertexEnumerator *pEnumerator) |
This method takes an operation that you
define (derived from VertexEnumerator) and
applies it to all the vertices of the specified face. |
|
unsigned int | EnumerateAdjacentVertices (AdjacentVertexEnumerator *pEnumerator, unsigned int iVertexIndex, unsigned int iFaceIndex) |
This method takes an operation that you
define (derived from VertexEnumerator) and
applies it to all the vertices adjacent to the specified one. It
returns the number of vertices that were visited. |
|
virtual int | MeshVersion (void) const |
Obsolete method; do not use. |
|
virtual void | SmoothTextureCoordinates (float fStrength) |
Obsolete method; do not use. |
|
virtual void | RecalculateNormals (bool bKeep=false) |
Recalculates all the vertex normals. This is
called after the mesh shape has changed. |
|
virtual void | RecalculateAdjacency (bool bForce=true) |
Causes the mesh to build internal adjacency
tables, if they don't exist already. |
|
virtual unsigned int | CollectionID (void) const |
Obsolete method; do not use. |
|
virtual void | IncreaseCollectionID (void) |
Obsolete method; do not use. |
|
virtual bool | IsSelected (void) |
Returns true if the whole mesh is selected.
|
|
virtual void | SetSelected (bool bOn=true) |
Selects or unselects the whole mesh.
|
|
virtual class LayerMeshData * | AddLayer (void) |
Creates and returns a new empty sculpt layer
for this mesh, and makes it current. |
|
virtual class LayerMeshData * | ActiveLayer (void) const |
Returns a pointer to the current sculpt
layer for this mesh. |
|
virtual bool | IsActiveLevel (void) const |
Returns true if this mesh is the
currently displayed mesh of the Geometry object it is part of.
|
|
virtual bool | Lock (class MeshUnlocker *pUnlocker=NULL) |
Locks the mesh for exclusive modifications.
|
|
virtual bool | Unlock (void) |
Unlock the mesh. |
|
virtual bool | IsLocked (void) |
Returns true if the mesh is locked. |
|
MeshChange * | StartChange (void) |
This method must be called by any plugin
before it modifies vertex data. |
|
virtual bool | IsNSided (void) |
Returns if the mesh contains non tri or quad
faces. |
|
virtual bool | HasExpandedTCs (void) const |
Returns if the mesh has edge bleeded
TC layout.
|
|
virtual void | CreateExpandedTCs (void) |
Calculates the edge bleeded TC layout. |
|
virtual TC & | ExpandedTC (unsigned int index) |
Returns the Expanded TC value for the given vertex.
|
|
Static Public Member Functions |
|
const mudbox::ClassDesc * | StaticClass (void) |
mudbox::Node * | CreateInstances (unsigned int iCount=1) |
Public Attributes |
|
Store< TC > | m_pTCs |
Protected Member Functions |
|
Mesh (FaceType eFaceType=typeQuadric) | |
Constructor. Do not use directly. |
|
Protected Attributes |
|
Store< Vertex > | m_pVertices |
unsigned int | m_iVertexCount |
|
Constructor. Do not use directly. Instead of constructing Meshes directly, you should use CreateInstance() like this: Mesh *myNewMesh = CreateInstance<Mesh>();
|
|
Reimplemented from mudbox::TreeNode. Reimplemented in mudbox::SubdivisionLevel. 00230 : |
|
Reimplemented from mudbox::TreeNode. Reimplemented in mudbox::SubdivisionLevel. |
|
Reimplemented from mudbox::TreeNode. Reimplemented in mudbox::SubdivisionLevel. |
|
Returns a pointer to the Geometry object that this mesh belongs to. Reimplemented in mudbox::SubdivisionLevel. |
|
Returns a pointer to a MeshRenderer with the desired level-of-detail (see MeshRenderer for more information).
|
|
Copy the content of this mesh to another one. |
|
Returns a pointer to the Material associated with this mesh. |
|
Returns the number of vertices in the mesh.
00260 { return m_iVertexCount; };
|
|
Sets the number of vertices in the mesh. Any existing data (that fits) will be kept.
|
|
Returns the number of texture coordinates in the mesh. 00268 { return m_pTCs.ItemCount(); }; |
|
Sets the number of texture coordinate vertices in the mesh.
|
|
This method returns a pointer to the actual array data. This is used in cases where very fast access to the array data is required (i.e. not going through methods) 00279 { return &m_pVertices[0]; }; |
|
Returns a vertex.
00284 { return m_pVertices[iVertexIndex]; }; |
|
Returns a vertex.
00289 { return m_pVertices[iVertexIndex]; }; |
|
Returns the x,y,z position of the vertex with the given index.
00294 { return m_pVertices[iVertexIndex].m_vPos; }; |
|
Returns the x,y,z position of the vertex with the given index.
00299 { return m_pVertices[iVertexIndex].m_vPos; }; |
|
Returns the position of the vertex before the current sculpting-brush stroke. If no stroke is in progress, result is the same as VertexPosition().
00306 { return m_pVertices[iVertexIndex].m_vPos; }; |
|
Returns the specified texture coordinate.
00311 { return m_pTCs[iVertexTCIndex]; }; |
|
Returns the normal of the vertex with the given index.
00316 { return Vector( m_pVertices[iVertexIndex].m_vNormal ); };
|
|
Internal use only. Do not call this method. 00320 { return m_pVertices[iVertexIndex].m_iStrokeID; }; |
|
Returns the layer mask of the vertex with the given index for the current sculpt layer. Each sculpt layer contains vertex offsets for some subset of vertices in the mesh. Each vertex in a mesh has a mask value for each sculpt layer associated with it. This mask determines how much the vertex offset of that sculpt layer contributes to the final position of the vertex when all the sculpt layers are composited together. This mask is a multiplier, so 0.0 means the layer offset is completely masked, and 1.0 means it is not masked at all.
00334 { return m_pVertices[iVertexIndex].Mask(); }; |
|
Returns the freeze value of the vertex with the given index. (0.0 is not frozen; 1.0 is completely frozen). The freeze value is used to lock parts of the mesh so they are less affected by sculpting brushes. It is the responsibility of every sculpt brush to take into account the Freeze values on vertices it is modifying.
00345 { return m_pVertices[iVertexIndex].Freeze(); }; |
|
Returns the number of vertices having a non-zero freeze value. If the result is 0, no part of the mesh is frozen. |
|
Returns the normal of the vertex with the given index as an array of 16-bit signed values.
00355 { return m_pVertices[iVertexIndex].m_vNormal; }; |
|
Returns the normal of the vertex with the given index as a single 64-bit signed value.
00361 { return m_pVertices[iVertexIndex].m_iNormal; }; |
|
00365 { return m_pVertices[iVertexIndex].m_iNormalIndex; }; |
|
Returns the bounding box of the mesh in local space. |
|
Sets the position of the vertex with the given index.
00374 { m_pVertices[iVertexIndex].m_vPos = vPosition; }; |
|
Adds vPosition to the current position of the vertex with the given index.
00381 { m_pVertices[iVertexIndex].m_vPos += vPosition; }; |
|
Internal use only. Do not call. 00385 { 00386 m_pVertices[iVertexIndex].m_vNormal[0] = tnormal(pNormal[3]); 00387 m_pVertices[iVertexIndex].m_vNormal[1] = tnormal(pNormal[2]); 00388 m_pVertices[iVertexIndex].m_vNormal[2] = tnormal(pNormal[1]); 00389 }; |
|
Sets the normal of the vertex with the given index.
00396 { 00397 m_pVertices[iVertexIndex].m_vNormal[0] = tnormal(vNormal.x * MB_NORMALMAX); 00398 m_pVertices[iVertexIndex].m_vNormal[1] = tnormal(vNormal.y * MB_NORMALMAX); 00399 m_pVertices[iVertexIndex].m_vNormal[2] = tnormal(vNormal.z * MB_NORMALMAX); 00400 }; |
|
Internal use only. Do not call. 00410 { m_pVertices[iVertexIndex].m_iNormalIndex = iNormal; }; |
|
Sets the freeze value for the vertex with the given index.
|
|
Internal use only. Do not call. |
|
Internal use only. Do not call. 00425 { m_pVertices[iVertexIndex].m_iStrokeID = iStrokeID; }; |
|
Mark a particular vertex. This method, along with Mesh::IsVertexMarked() and Mesh::ClearVertexMarks() is used to aid in traversing all the vertices in a mesh. An algorithm can mark the vertices as it visits them to ensure that it don't visit any twice, and then clear all the marks when complete.
|
|
Returns true if a particular vertex is marked. This method, along with Mesh::MarkVertex() and Mesh::ClearVertexMarks() is used to aid in traversing all the vertices in a mesh. An algorithm can mark the vertices as it visits them to ensure that it don't visit any twice, and then clear all the marks when complete.
|
|
Clears all vertex marks. This method, along with Mesh::MarkVertex() and Mesh::IsVertexMarked() is used to aid in traversing all the vertices in a mesh. An algorithm can mark the vertices as it visits them to ensure that it don't visit any twice, and then clear all the marks when complete. This is a very fast function. |
|
Returns the position of a corner of a mesh face. Can be used for triangular meshes only.
00461 { return VertexPosition( TriangleIndex( iTriangleIndex, iCornerIndex ) ); }; |
|
Returns the position of a corner of a mesh face. Can be used for quadric meshes only.
00467 { return VertexPosition( QuadIndex( iQuadIndex, iCornerIndex ) ); }; |
|
Returns the texture coordinates of a corner of a mesh face. Can be used for triangular meshes only.
00474 { return VertexTC( TriangleTCI( iTriangleIndex, iCornerIndex ) ); }; |
|
Returns the texture coordinates of a corner of a mesh face. Can be used for quadric meshes only.
|
|
Returns the normal of a corner of a mesh face. Can be used for triangular meshes only.
00486 { return VertexNormal( TriangleIndex( iTriangleIndex, iCornerIndex ) ); }; |
|
Returns the normal of a corner of a mesh face. Can be used for quad meshes only.
00492 { return VertexNormal( QuadIndex( iQuadIndex, iCornerIndex ) ); }; |
|
Returns the freeze value of a corner of a mesh face. Can be used for triangular meshes only.
00498 { return VertexFreeze( TriangleIndex( iTriangleIndex, iCornerIndex ) ); }; |
|
Returns the freeze value of a corner of a mesh face. (0.0 is not frozen, 1.0 is completely frozen) Can be used for quadric meshes only.
00505 { return VertexFreeze( QuadIndex( iQuadIndex, iCornerIndex ) ); }; |
|
Returns the normal of a corner of a triangle mesh face as an array of 16-bit signed values.
00511 { return VertexNormalArray( TriangleIndex( iTriangleIndex, iCornerIndex ) ); }; |
|
Returns the normal of a corner of a quad mesh face as an array of 16-bit signed values.
00517 { return VertexNormalArray( QuadIndex( iQuadIndex, iCornerIndex ) ); }; |
|
Returns the normal a corner of a triangle mesh face as a single 64-bit signed value.
00523 { return VertexNormalValue( TriangleIndex( iTriangleIndex, iCornerIndex ) ); }; |
|
Returns the normal a corner of a quad mesh face as a single 64-bit signed value.
00529 { return VertexNormalValue( QuadIndex( iQuadIndex, iCornerIndex ) ); }; |
|
This method takes an operation that you define (derived from FaceEnumerator) and applies it to the specified face, and sequentially to its neighbors, then the neighbors of those faces, until the mesh has been covered. In normal use, the entire mesh would not be covered. The FaceEnumerator's Tester() function returns false to limit the spread to a particular area. For example, this is used by sculpt operations to touch all the faces inside the brush ring. See FaceEnumerator for more details.
|
|
This method takes an operation that you define (derived from FaceEnumerator) and applies it to the specified face, and sequentially to its immediate neighbours. See FaceEnumerator for more details.
|
|
This method takes an operation that you define (derived from VertexEnumerator) and applies it to all the vertices of the specified face. See VertexEnumerator for more details.
|
|
This method takes an operation that you define (derived from VertexEnumerator) and applies it to all the vertices adjacent to the specified one. It returns the number of vertices that were visited. See VertexEnumerator for more details.
|
|
Obsolete method; do not use. |
|
Obsolete method; do not use. |
|
Recalculates all the vertex normals. This is called after the mesh shape has changed.
|
|
Causes the mesh to build internal adjacency tables, if they don't exist already.
|
|
Obsolete method; do not use. |
|
Obsolete method; do not use. |
|
Returns true if the whole mesh is selected. |
|
Selects or unselects the whole mesh. |
|
Creates and returns a new empty sculpt layer for this mesh, and makes it current. |
|
Returns a pointer to the current sculpt layer for this mesh. |
|
Returns true if this mesh is the currently displayed mesh of the Geometry object it is part of. |
|
Locks the mesh for exclusive modifications. The caller of this function will get exclusive rights to modify the data stored in the mesh if the return value is true. In other words, mudbox guarantees that no other code will modify the mesh until it is unlocked. The caller can pass the address of a MeshUnlocker objects, which will be used to determine if the mesh can be unlocked, and can perform actions before the unlock happens.
|
|
Unlock the mesh. Returns true if the operation was executed successfully, or if the mesh was unlocked at the time of the call. If the mesh was locked, and a MeshUnlocker object was specified by the Lock call, that MeshUnlocker object will be used to determine if the mesh can be unlocked. |
|
Returns true if the mesh is locked. |
|
This method must be called by any plugin before it modifies vertex data. It returns a MeshChange object that will hold the needed undo information. |
|
Returns if the mesh contains non tri or quad faces. |
|
Returns if the mesh has edge bleeded TC layout. Can be used instead of the normal TC layot if we want to modify texture without artifact at shell borders. |
|
Calculates the edge bleeded TC layout. |
|
Returns the Expanded TC value for the given vertex. |
|
|
|